package ltd.hxya.novel.entity.book;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import ltd.hxya.novel.entity.base.BaseEntity;
import ltd.hxya.novel.entity.valid.SaveOperate;
import ltd.hxya.novel.entity.valid.UpdateOperate;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * <p>
 * 小说类别表
 * </p>
 *
 * @author hty
 * @since 2022-10-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("book_category")
@ApiModel(value="BookCategory对象", description="小说类别表")
public class BookCategory extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "分类id不能为空",groups = {UpdateOperate.class})
    @Null(message = "分类id必须为空",groups = {SaveOperate.class})
    private Integer id;

    @ApiModelProperty(value = "分类条件，0：主题，1：角色，2：情节")
    private Integer categoryCondition;

    @ApiModelProperty(value = "作品方向，0：男频，1：女频'")
    private Boolean workDirection;

    @ApiModelProperty(value = "分类名")
    private String name;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    private Integer createUserId;

    private String updateUserId;



}
